﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        
        public Form1()
        {
            InitializeComponent();
        }
        // Make Addition between two value
        private void button1_Click(object sender, EventArgs e)
        {
            int a = Convert.ToInt32(textBox1.Text);
            int b = Convert.ToInt32(textBox2.Text);
            int c = a + b;
            label1.Text = Convert.ToString(c);
            
        }
        // Make Substraction between two value
        private void button2_Click(object sender, EventArgs e)
        {
            int a = Convert.ToInt32(textBox1.Text);
            int b = Convert.ToInt32(textBox2.Text);
            int c = a - b;
            label1.Text = Convert.ToString(c);
        }
        // Make Muntiplication between two value
        private void button3_Click(object sender, EventArgs e)
        {
            int a = Convert.ToInt32(textBox1.Text);
            int b = Convert.ToInt32(textBox2.Text);
            int c = a * b;
            label1.Text = Convert.ToString(c);
        }
        // Make Division between two value
        private void button4_Click(object sender, EventArgs e)
        {
            int a = Convert.ToInt32(textBox1.Text);
            int b = Convert.ToInt32(textBox2.Text);
            int c = a / b;
            label1.Text = Convert.ToString(c);
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            
        }
        // Validation only Number input 
        private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            char ch = e.KeyChar;

            if (!char.IsDigit(ch) && !char.IsNumber(ch) && ch != 8)
            {
                e.Handled = true;
            }
        }
        // Validation only Number input
        private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
        {
            char ch = e.KeyChar;

            if (!char.IsDigit(ch) && !char.IsNumber(ch) && ch != 8)
            {
                e.Handled = true;
            }
        }

    }
}
